﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QDir>

class QListWidgetItem;

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    //条目类型枚举
    enum ITypes{ IDriver = 1999, IFolder = 2000, IFile = 2001 };

private slots:
    void on_pushButtonEnter_clicked();

    void on_pushButtonDrivers_clicked();

    void on_pushButtonParent_clicked();

    void on_listWidget_itemDoubleClicked(QListWidgetItem *item);

    void on_listWidget_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);

private:
    Ui::MainWindow *ui;
    QIcon m_iconDriver;
    QIcon m_iconFolder;
    QIcon m_iconFile;

    QDir m_curDir;
    void ShowItems(const QDir& dir);
    QString GetFileInfo(const QFileInfo& fi);
    QString GetFolderInfo(const QFileInfo& fi);
};
#endif // MAINWINDOW_H
